<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<title>WorksheetProtectionBlock (POI API Documentation)</title>
<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">
</head>
<body>
<script type="text/javascript"><!--
    if (location.href.indexOf('is-external=true') == -1) {
        parent.document.title="WorksheetProtectionBlock (POI API Documentation)";
    }
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!--   -->
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<!--   -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/WorksheetProtectionBlock.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../../org/apache/poi/hssf/record/aggregates/ValueRecordsAggregate.html" title="class in org.apache.poi.hssf.record.aggregates"><span class="strong">PREV CLASS</span></a></li>
<li>NEXT CLASS</li>
</ul>
<ul class="navList">
<li><a href="../../../../../../index.html?org/apache/poi/hssf/record/aggregates/WorksheetProtectionBlock.html" target="_top">FRAMES</a></li>
<li><a href="WorksheetProtectionBlock.html" target="_top">NO FRAMES</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
  allClassesLink = document.getElementById("allclasses_navbar_top");
  if(window==top) {
    allClassesLink.style.display = "block";
  }
  else {
    allClassesLink.style.display = "none";
  }
  //-->
</script>
</div>
<div>
<ul class="subNavList">
<li>SUMMARY:&nbsp;</li>
<li><a href="#nested_classes_inherited_from_class_org.apache.poi.hssf.record.aggregates.RecordAggregate">NESTED</a>&nbsp;|&nbsp;</li>
<li>FIELD&nbsp;|&nbsp;</li>
<li><a href="#constructor_summary">CONSTR</a>&nbsp;|&nbsp;</li>
<li><a href="#method_summary">METHOD</a></li>
</ul>
<ul class="subNavList">
<li>DETAIL:&nbsp;</li>
<li>FIELD&nbsp;|&nbsp;</li>
<li><a href="#constructor_detail">CONSTR</a>&nbsp;|&nbsp;</li>
<li><a href="#method_detail">METHOD</a></li>
</ul>
</div>
<a name="skip-navbar_top">
<!--   -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<p class="subTitle">org.apache.poi.hssf.record.aggregates</p>
<h2 title="Class WorksheetProtectionBlock" class="title">Class WorksheetProtectionBlock</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li>java.lang.Object</li>
<li>
<ul class="inheritance">
<li><a href="../../../../../../org/apache/poi/hssf/record/RecordBase.html" title="class in org.apache.poi.hssf.record">org.apache.poi.hssf.record.RecordBase</a></li>
<li>
<ul class="inheritance">
<li><a href="../../../../../../org/apache/poi/hssf/record/aggregates/RecordAggregate.html" title="class in org.apache.poi.hssf.record.aggregates">org.apache.poi.hssf.record.aggregates.RecordAggregate</a></li>
<li>
<ul class="inheritance">
<li>org.apache.poi.hssf.record.aggregates.WorksheetProtectionBlock</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<hr>
<br>
<pre>public final class <strong>WorksheetProtectionBlock</strong>
extends <a href="../../../../../../org/apache/poi/hssf/record/aggregates/RecordAggregate.html" title="class in org.apache.poi.hssf.record.aggregates">RecordAggregate</a></pre>
<div class="block">Groups the sheet protection records for a worksheet.
 <p/>

 See OOO excelfileformat.pdf sec 4.18.2 'Sheet Protection in a Workbook
 (BIFF5-BIFF8)'</div>
<dl><dt><span class="strong">Author:</span></dt>
  <dd>Josh Micich</dd></dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ======== NESTED CLASS SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="nested_class_summary">
<!--   -->
</a>
<h3>Nested Class Summary</h3>
<ul class="blockList">
<li class="blockList"><a name="nested_classes_inherited_from_class_org.apache.poi.hssf.record.aggregates.RecordAggregate">
<!--   -->
</a>
<h3>Nested classes/interfaces inherited from class&nbsp;org.apache.poi.hssf.record.aggregates.<a href="../../../../../../org/apache/poi/hssf/record/aggregates/RecordAggregate.html" title="class in org.apache.poi.hssf.record.aggregates">RecordAggregate</a></h3>
<code><a href="../../../../../../org/apache/poi/hssf/record/aggregates/RecordAggregate.PositionTrackingVisitor.html" title="class in org.apache.poi.hssf.record.aggregates">RecordAggregate.PositionTrackingVisitor</a>, <a href="../../../../../../org/apache/poi/hssf/record/aggregates/RecordAggregate.RecordVisitor.html" title="interface in org.apache.poi.hssf.record.aggregates">RecordAggregate.RecordVisitor</a></code></li>
</ul>
</li>
</ul>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_summary">
<!--   -->
</a>
<h3>Constructor Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><strong><a href="../../../../../../org/apache/poi/hssf/record/aggregates/WorksheetProtectionBlock.html#WorksheetProtectionBlock()">WorksheetProtectionBlock</a></strong>()</code>
<div class="block">Creates an empty WorksheetProtectionBlock</div>
</td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method_summary">
<!--   -->
</a>
<h3>Method Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span>Methods</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../../../org/apache/poi/hssf/record/aggregates/WorksheetProtectionBlock.html#addRecords(org.apache.poi.hssf.model.RecordStream)">addRecords</a></strong>(<a href="../../../../../../org/apache/poi/hssf/model/RecordStream.html" title="class in org.apache.poi.hssf.model">RecordStream</a>&nbsp;rs)</code>
<div class="block">This method reads <a href="../../../../../../org/apache/poi/hssf/record/aggregates/WorksheetProtectionBlock.html" title="class in org.apache.poi.hssf.record.aggregates"><code>WorksheetProtectionBlock</code></a> records from the supplied RecordStream
 until the first non-WorksheetProtectionBlock record is encountered.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../../../../../org/apache/poi/hssf/record/ScenarioProtectRecord.html" title="class in org.apache.poi.hssf.record">ScenarioProtectRecord</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../../org/apache/poi/hssf/record/aggregates/WorksheetProtectionBlock.html#getHCenter()">getHCenter</a></strong>()</code>&nbsp;</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><strong><a href="../../../../../../org/apache/poi/hssf/record/aggregates/WorksheetProtectionBlock.html#getPasswordHash()">getPasswordHash</a></strong>()</code>&nbsp;</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../../../../../org/apache/poi/hssf/record/PasswordRecord.html" title="class in org.apache.poi.hssf.record">PasswordRecord</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../../org/apache/poi/hssf/record/aggregates/WorksheetProtectionBlock.html#getPasswordRecord()">getPasswordRecord</a></strong>()</code>&nbsp;</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static boolean</code></td>
<td class="colLast"><code><strong><a href="../../../../../../org/apache/poi/hssf/record/aggregates/WorksheetProtectionBlock.html#isComponentRecord(int)">isComponentRecord</a></strong>(int&nbsp;sid)</code>&nbsp;</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><strong><a href="../../../../../../org/apache/poi/hssf/record/aggregates/WorksheetProtectionBlock.html#isObjectProtected()">isObjectProtected</a></strong>()</code>&nbsp;</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><strong><a href="../../../../../../org/apache/poi/hssf/record/aggregates/WorksheetProtectionBlock.html#isScenarioProtected()">isScenarioProtected</a></strong>()</code>&nbsp;</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><strong><a href="../../../../../../org/apache/poi/hssf/record/aggregates/WorksheetProtectionBlock.html#isSheetProtected()">isSheetProtected</a></strong>()</code>&nbsp;</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../../../org/apache/poi/hssf/record/aggregates/WorksheetProtectionBlock.html#protectSheet(java.lang.String, boolean, boolean)">protectSheet</a></strong>(java.lang.String&nbsp;password,
            boolean&nbsp;shouldProtectObjects,
            boolean&nbsp;shouldProtectScenarios)</code>
<div class="block">protect a spreadsheet with a password (not encrypted, just sets protect
 flags and the password.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../../../org/apache/poi/hssf/record/aggregates/WorksheetProtectionBlock.html#visitContainedRecords(org.apache.poi.hssf.record.aggregates.RecordAggregate.RecordVisitor)">visitContainedRecords</a></strong>(<a href="../../../../../../org/apache/poi/hssf/record/aggregates/RecordAggregate.RecordVisitor.html" title="interface in org.apache.poi.hssf.record.aggregates">RecordAggregate.RecordVisitor</a>&nbsp;rv)</code>
<div class="block">Visit each of the atomic BIFF records contained in this <a href="../../../../../../org/apache/poi/hssf/record/aggregates/RecordAggregate.html" title="class in org.apache.poi.hssf.record.aggregates"><code>RecordAggregate</code></a> in the order
 that they should be written to file.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_org.apache.poi.hssf.record.aggregates.RecordAggregate">
<!--   -->
</a>
<h3>Methods inherited from class&nbsp;org.apache.poi.hssf.record.aggregates.<a href="../../../../../../org/apache/poi/hssf/record/aggregates/RecordAggregate.html" title="class in org.apache.poi.hssf.record.aggregates">RecordAggregate</a></h3>
<code><a href="../../../../../../org/apache/poi/hssf/record/aggregates/RecordAggregate.html#getRecordSize()">getRecordSize</a>, <a href="../../../../../../org/apache/poi/hssf/record/aggregates/RecordAggregate.html#serialize(int, byte[])">serialize</a></code></li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_java.lang.Object">
<!--   -->
</a>
<h3>Methods inherited from class&nbsp;java.lang.Object</h3>
<code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_detail">
<!--   -->
</a>
<h3>Constructor Detail</h3>
<a name="WorksheetProtectionBlock()">
<!--   -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>WorksheetProtectionBlock</h4>
<pre>public&nbsp;WorksheetProtectionBlock()</pre>
<div class="block">Creates an empty WorksheetProtectionBlock</div>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method_detail">
<!--   -->
</a>
<h3>Method Detail</h3>
<a name="isComponentRecord(int)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isComponentRecord</h4>
<pre>public static&nbsp;boolean&nbsp;isComponentRecord(int&nbsp;sid)</pre>
<dl><dt><span class="strong">Returns:</span></dt><dd><code>true</code> if the specified Record sid is one belonging to
         the 'Page Settings Block'.</dd></dl>
</li>
</ul>
<a name="visitContainedRecords(org.apache.poi.hssf.record.aggregates.RecordAggregate.RecordVisitor)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>visitContainedRecords</h4>
<pre>public&nbsp;void&nbsp;visitContainedRecords(<a href="../../../../../../org/apache/poi/hssf/record/aggregates/RecordAggregate.RecordVisitor.html" title="interface in org.apache.poi.hssf.record.aggregates">RecordAggregate.RecordVisitor</a>&nbsp;rv)</pre>
<div class="block"><strong>Description copied from class:&nbsp;<code><a href="../../../../../../org/apache/poi/hssf/record/aggregates/RecordAggregate.html#visitContainedRecords(org.apache.poi.hssf.record.aggregates.RecordAggregate.RecordVisitor)">RecordAggregate</a></code></strong></div>
<div class="block">Visit each of the atomic BIFF records contained in this <a href="../../../../../../org/apache/poi/hssf/record/aggregates/RecordAggregate.html" title="class in org.apache.poi.hssf.record.aggregates"><code>RecordAggregate</code></a> in the order
 that they should be written to file.  Implementors may or may not return the actual
 <a href="../../../../../../org/apache/poi/hssf/record/Record.html" title="class in org.apache.poi.hssf.record"><code>Record</code></a>s being used to manage POI's internal implementation.  Callers should not
 assume either way, and therefore only attempt to modify those <a href="../../../../../../org/apache/poi/hssf/record/Record.html" title="class in org.apache.poi.hssf.record"><code>Record</code></a>s after cloning</div>
<dl>
<dt><strong>Specified by:</strong></dt>
<dd><code><a href="../../../../../../org/apache/poi/hssf/record/aggregates/RecordAggregate.html#visitContainedRecords(org.apache.poi.hssf.record.aggregates.RecordAggregate.RecordVisitor)">visitContainedRecords</a></code>&nbsp;in class&nbsp;<code><a href="../../../../../../org/apache/poi/hssf/record/aggregates/RecordAggregate.html" title="class in org.apache.poi.hssf.record.aggregates">RecordAggregate</a></code></dd>
</dl>
</li>
</ul>
<a name="getPasswordRecord()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getPasswordRecord</h4>
<pre>public&nbsp;<a href="../../../../../../org/apache/poi/hssf/record/PasswordRecord.html" title="class in org.apache.poi.hssf.record">PasswordRecord</a>&nbsp;getPasswordRecord()</pre>
</li>
</ul>
<a name="getHCenter()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getHCenter</h4>
<pre>public&nbsp;<a href="../../../../../../org/apache/poi/hssf/record/ScenarioProtectRecord.html" title="class in org.apache.poi.hssf.record">ScenarioProtectRecord</a>&nbsp;getHCenter()</pre>
</li>
</ul>
<a name="addRecords(org.apache.poi.hssf.model.RecordStream)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>addRecords</h4>
<pre>public&nbsp;void&nbsp;addRecords(<a href="../../../../../../org/apache/poi/hssf/model/RecordStream.html" title="class in org.apache.poi.hssf.model">RecordStream</a>&nbsp;rs)</pre>
<div class="block">This method reads <a href="../../../../../../org/apache/poi/hssf/record/aggregates/WorksheetProtectionBlock.html" title="class in org.apache.poi.hssf.record.aggregates"><code>WorksheetProtectionBlock</code></a> records from the supplied RecordStream
 until the first non-WorksheetProtectionBlock record is encountered. As each record is read,
 it is incorporated into this WorksheetProtectionBlock.
 <p/>
 As per the OOO documentation, the protection block records can be expected to be written
 together (with no intervening records), but earlier versions of POI (prior to Jun 2009)
 didn't do this.  Workbooks with sheet protection created by those earlier POI versions
 seemed to be valid (Excel opens them OK). So PO allows continues to support reading of files
 with non continuous worksheet protection blocks.

 <p/>
 <b>Note</b> - when POI writes out this WorksheetProtectionBlock, the records will always be
 written in one consolidated block (in the standard ordering) regardless of how scattered the
 records were when they were originally read.</div>
</li>
</ul>
<a name="protectSheet(java.lang.String, boolean, boolean)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>protectSheet</h4>
<pre>public&nbsp;void&nbsp;protectSheet(java.lang.String&nbsp;password,
                boolean&nbsp;shouldProtectObjects,
                boolean&nbsp;shouldProtectScenarios)</pre>
<div class="block">protect a spreadsheet with a password (not encrypted, just sets protect
 flags and the password.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>password</code> - to set. Pass <code>null</code> to remove all protection</dd><dd><code>shouldProtectObjects</code> - are protected</dd><dd><code>shouldProtectScenarios</code> - are protected</dd></dl>
</li>
</ul>
<a name="isSheetProtected()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isSheetProtected</h4>
<pre>public&nbsp;boolean&nbsp;isSheetProtected()</pre>
</li>
</ul>
<a name="isObjectProtected()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isObjectProtected</h4>
<pre>public&nbsp;boolean&nbsp;isObjectProtected()</pre>
</li>
</ul>
<a name="isScenarioProtected()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isScenarioProtected</h4>
<pre>public&nbsp;boolean&nbsp;isScenarioProtected()</pre>
</li>
</ul>
<a name="getPasswordHash()">
<!--   -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>getPasswordHash</h4>
<pre>public&nbsp;int&nbsp;getPasswordHash()</pre>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar_bottom">
<!--   -->
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
<!--   -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/WorksheetProtectionBlock.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../../org/apache/poi/hssf/record/aggregates/ValueRecordsAggregate.html" title="class in org.apache.poi.hssf.record.aggregates"><span class="strong">PREV CLASS</span></a></li>
<li>NEXT CLASS</li>
</ul>
<ul class="navList">
<li><a href="../../../../../../index.html?org/apache/poi/hssf/record/aggregates/WorksheetProtectionBlock.html" target="_top">FRAMES</a></li>
<li><a href="WorksheetProtectionBlock.html" target="_top">NO FRAMES</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
  allClassesLink = document.getElementById("allclasses_navbar_bottom");
  if(window==top) {
    allClassesLink.style.display = "block";
  }
  else {
    allClassesLink.style.display = "none";
  }
  //-->
</script>
</div>
<div>
<ul class="subNavList">
<li>SUMMARY:&nbsp;</li>
<li><a href="#nested_classes_inherited_from_class_org.apache.poi.hssf.record.aggregates.RecordAggregate">NESTED</a>&nbsp;|&nbsp;</li>
<li>FIELD&nbsp;|&nbsp;</li>
<li><a href="#constructor_summary">CONSTR</a>&nbsp;|&nbsp;</li>
<li><a href="#method_summary">METHOD</a></li>
</ul>
<ul class="subNavList">
<li>DETAIL:&nbsp;</li>
<li>FIELD&nbsp;|&nbsp;</li>
<li><a href="#constructor_detail">CONSTR</a>&nbsp;|&nbsp;</li>
<li><a href="#method_detail">METHOD</a></li>
</ul>
</div>
<a name="skip-navbar_bottom">
<!--   -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>
                <i>Copyright 2014 The Apache Software Foundation or
        its licensors, as applicable.</i>
            </small></p>
</body>
</html>
